<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Home.Master" Inherits="System.Web.Mvc.ViewPage<Aga.Psad.Mvc.Models.Clientes.ClienteViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Detalles de Cliente
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="sidebar">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="box-style3">
            <tr>
                <td>
                    <h2>
                        <span>Adm.</span> de Clientes</h2>
                </td>
            </tr>
            <tr>
                <td>
                    <ul>
                        <li class="first"><a href="<%= VirtualPathUtility.ToAbsolute("~/Clientes/Index") %>">
                            Ver Clientes</a></li>
                        <li><a href="<%= VirtualPathUtility.ToAbsolute("~/Clientes/Create") %>">Nuevo Cliente</a></li>
                    </ul>
                </td>
            </tr>
        </table>
    </div>
    <div id="content">
        <div id="Div1">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="box-style1">
                <tr>
                    <td id="box2">
                        <h2>
                            Detalles de Cliente</h2>
                        <br />
                        <fieldset>
                            <legend>Cliente</legend>
                            <p>
                                <b>Id:</b>
                                <%= Html.Encode(Model.Id) %>
                            <br />
                                <b>Raz&oacute;n Social:</b>
                                <%= Html.Encode(Model.RazonSocial) %>
                            <br />
                                <b>Cuit:</b>
                                <%= Html.Encode(Model.Cuit) %>
                            <br />
                                <b>Usuario:</b>
                                <%= Html.Encode(Model.Usuario) %>
                            </p>
                            <fieldset>
                                <legend>Clientes de Clientes</legend>
                                <table>
                                    <tr>
                                        <th>
                                            Raz&oacute;n Social
                                        </th>
                                        <th>
                                            Cuit
                                        </th>
                                        <th>
                                            Usuario
                                        </th>
                                        <th>
                                        </th>
                                    </tr>
                                    <% if (Model.Clientes.Count() == 0)
                                       { %>
                                    <tr>
                                        <td colspan="4">
                                            No hay datos para mostrar
                                        </td>
                                    </tr>
                                    <% }
                                       else
                                       {
                                           foreach (var item in Model.Clientes)
                                           { %>
                                    <tr>
                                        <td>
                                            <%= Html.Encode(item.RazonSocial)%>
                                        </td>
                                        <td>
                                            <%= Html.Encode(item.Cuit)%>
                                        </td>
                                        <td>
                                            <%= Html.Encode(item.Usuario)%>
                                        </td>
                                        <td>
                                            <%= Html.ActionLink("Eliminar", "RemoveCliente", new { id = item.Id })%>
                                            |
                                            <%= Html.ActionLink("Editar", "EditCliente", new { id = item.Id })%>
                                        </td>
                                    </tr>
                                    <% 
                                        }
               } %>
                                </table>
                                <div>
                                    <%= Html.ActionLink("Nuevo Cliente de Cliente", "CreateCliente", new { id = Model.Id })%>
                                </div>
                            </fieldset>
                        </fieldset>
                        <p>
                            <%=Html.ActionLink("Editar", "Edit", new { id = Model.Id })%>
                            |
                            <%=Html.ActionLink("Volver al Listado", "Index")%>
                        </p>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
